package com.ListDemo;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @Author milian
 * @Date 2021/7/24 0024 19:18
 */
public class hw1 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("def");
        arrayList.add("de");
        arrayList.add("def");
        arrayList.add("de");
        arrayList.add("ef");
        arrayList.add("def");
        arrayList.removeIf(s -> {
           if (s.equals("def"))
               return true;
           return false;
        });
        Iterator iterator = arrayList.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
